--[[
R级装备难1~2的毕业装备
难2开启词条自由洗练
]]

local item_class = require 'types.item'

local excel = {}
for _,data in ipairs(load_excel('符文装备.xlsx','3级装备')) do
    local name = data.name
    local level = data.lv
    if name and level==7 then
        local data = table.copy(data)
        local state = {}
        
        for a=1,3 do
            local key = data['属性'..a]
            local num = data['数值'..a]
            if key and num then
                state[#state + 1] = {key,num}
                
                --血量和攻击
                if num>1000 then
                    state[#state + 1] = {'基础攻击',num*0.5}
                end
                if key=='技能暴击' then
                    num = num * 0.4
                end
                if key=='普攻暴击' then
                    num = num * 0.4
                end
            end
        end
        data.base_tip = atts_tip2(state)
        data.used_flag = false
        data.state = state
        data.abi_tip = ''
        data.item_class = '符文装备'
        data.tip = [['abi_tip'属性：|n'base_tip'|n'xl_tip''ex_tip']]
        data['随机词条'] = 3
        
        data.ex_tip = function(self)
            local player = self.owner_player or ac.player.self
            return ('所属玩家：%s|n|cff999999装备绑定玩家，可以租用|r'):format(player:get_name())
        end


        ac.lni('item',name,data)
        ac.item(name)

        excel[#excel + 1] = data
    end
end

--[获取随机R级物品名]
function random_item_SR()
    local data = table.random(excel)
    return data.name
end

ac.wait(10,function()
    local test_data1 = {}
    for _,data in ipairs(excel) do
        test_data1[#test_data1 + 1] = ac.item.new(data.name)
    end
    ac.game:notify('测试-注册数据','SR级装备',test_data1,function(_,player,name)
        local hero = player.hero
        if hero then
            hero:add_item(name)
        end
    end)


end)